import tester.cobertura.Instrument;

// to represent a song
@Instrument
class Song implements IsSame<Song>, IValue<Song>, MakeString<Song>/*, ISelectable<Song>*/{
	String title;
	String artist;
	int duration;  // in minutes

	Song(String title, String artist, int duration){
		this.title = title;
		this.artist = artist;
		this.duration = duration;
	}

	/* TEMPLATE
	 * ... this.title ...       -- String
	 * ... this.artist ...      -- String
	 * ... this.duration ...    -- int
	 * 
	 * ... this.size() ...        -- boolean
	 * ... this.isSame(Song) ...  -- boolean
	 */

	// compute the value of this song - determined by its duration
	@Override
	public int value(){
		return this.duration;
	}

	// is this song the same as the given song?
	@Override
	public boolean isSame(Song that){
		return this.title.equals(that.title) &&
		this.artist.equals(that.artist) &&
		this.duration == that.duration;
	}

	// a method to covert types to a string representation.
	@Override
	public String makeString(){
		return this.title + "-" +  this.artist + "-" +  Integer.toString(this.duration);
	}
	
	/*
	// ...
	@Override
	public boolean pick() {
		// TODO Auto-generated method stub
		return false;
	}
	*/
}